sysdir set PLUS "S:\Project\DemoSos2\common\felles\JR_RG\DrVA\plus"

************************************************************************
* PREPARE DATA
************************************************************************
* clean health datasets 
do clean_npr.do
do clean_health.do
* get work hours 
do clean_labormarket.do

* clean data sets (except health data)
do Cleaning_PreFinalSet.do
do Cleaning_PostFinalSetR2.do

************************************************************************
* ANALYSIS
************************************************************************
* Figure 1, Figure A7, Table A4 & VA construction for different variables; gets FE leave-one-out
do ValueAdded.do			 

* Figure A8, Tables A3, A5 (col5, 6), Table A8 (all swaps)
do ValueAdded_all.do 		

* Figure A9, Table A14 (VA for diff subgroups)
do ValueAdded_het.do		

* Table A12, Table A13, Figure A6: robustness to VA (functional forms & connected set)
do ValueAdded_robust.do		

* Figures: A2, A4, A5 Tables: 1, 2, 4, 5, 6, 7, A1, A2, A7, A9, A10, A15, A17, A18
* produces tables for relation between age at death, causes, GP & hospital visits and labor market outcomes and GP VA, falsification (leave-out)
do fe_analysis_new.do 		

* Table 3, Tables A3, A5 (col 1-4)
do fe_descriptives.do   	

* Tables 8, 9, 10, Table A6, A19
* Relation between endog swap and VA, ratings. Basic stats for the ratings 
do endog_va.do 		
		
* Figure A1 (map)
do map.do

* Figure A3
do mortality_byconditions.do

* Table A11: stayers vs leavers in case of reduction
do external_validity.do

* Table A16
do lasso_final.do


